home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Gamer (Italian) 30
/
PC Gamer IT CD 30 1-2.iso
/
MOTS
/
GAMEDATA
/
RESOURCE
/
JKMRES.GOO
/
cog_force_heal.cog
< prev
next >
Wrap
Text File
|
1998-02-25
|
3KB
|
139 lines
# Jedi Knight Cog Script
#
# FORCE_HEALING.COG
#
# FORCEPOWER Script - Healing
# Light Side Power
# Bin 25
#
# [YB]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
symbols
thing player local
flex cost=200.0 local
int rank local
flex mana local
sound healingSound=ForceHealing01.WAV local
int soundChannel=-1 local
template sphere_tpl=+force_heal local
int sphere=-1 local
vector position local
int inbubble=0 local
message startup
message activated
message newplayer
message killed
message selected
message enterbubble
message exitbubble
end
# ========================================================================================
code
startup:
player = GetLocalPlayerThing();
inbubble = 0;
call stop_power;
Return;
# ........................................................................................
activated:
if(inbubble) Return;
if((!IsInvActivated(player, 25)) && (GetThingHealth(player) != 100) && (GetThingHealth(player) > 0))
{
mana = GetInv(player, 14);
if(mana >= cost || GetInv(player, 14) >= GetInv(player, 69))
{
if(GetInv(player, 64) != 1) ChangeInv(player, 14, -cost);
// Send a "force disturbance"...
if(!IsMulti())
SendMessageExRadius(GetThingPos(player), cost, 0x4, splash, 25, 0, 0, 0);
SetInvActivated(player, 25, 1);
PlayMode(player, 24);
soundChannel = PlaySoundThing(healingSound, player, 1.0, -1, -1, 0x80);
rank = GetInv(player, 25);
SetBinWait(player, 25, 1.2);
// Create the sphere
position = VectorAdd(GetThingPos(player), '0.0 0.0 0.01');
sphere = CreateThingAtPosNR(sphere_tpl, GetThingSector(player), position, '0.0 0.0 0.0');
AttachThingToThingEx(sphere, player, 0x8);
Sleep(0.6);
SetParticleGrowthSpeed(sphere, -3.0);
// We don't want any strange things like a dead player with health in the HUD
if(GetThingHealth(player) > 0) HealThing(player, 20 * rank);
Sleep(0.40);
DestroyThing(sphere);
call stop_power;
}
}
Return;
# ........................................................................................
selected:
jkPrintUNIString(player, 25);
Return;
# ........................................................................................
killed:
if(GetSenderRef() != player) Return;
newplayer:
call stop_power;
Return;
# ........................................................................................
enterbubble:
inbubble = 1;
call stop_power;
Return;
# ........................................................................................
exitbubble:
inbubble = 0;
Return;
# ........................................................................................
stop_power:
SetInvActivated(player, 25, 0);
Return;
end